<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!--外部引入js脚本文件-->
    <script src="js/test.js" charset="UTF-8"></script>
</head>
<body>
<h1>声明函数的三种方式</h1>

<script>
    /*
    function add1(x,y){
        return x+y;
    }
    var add2 = function(x,y){
        return x+y;
    }
    var add3 = new Function("x","y","return x+y;");*/

    console.info(add1(10,7));
    console.info(add2(10,7));
    console.info(add3(10,7));
</script>
</body>
</html>